package com.cqjtu.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Objects;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Manifest {//任务清单表
    private Integer  manifestId;//任务清单id
    private String  manifestName;//任务名称
    private String  measure;//计量单位
    private String  quantity;//工程量
    private String  price;//综合单价
    private String  manifestRemark;//任务备注
    private Integer projectId;//项目id
    private String engineeringQuantityCompleted;//以完成工程量
    private String engineeringQuantityRemaining;//未完成工程量

    public boolean isNewManifest() {
        return manifestId == null;
    }

    @Override
    public boolean equals(Object o){
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Manifest that = (Manifest) o;
        if(!Objects.equals(this.manifestId, that.manifestId)){
            return false;
        }
        if(!this.manifestName.equals(that.manifestName)){
            return false;
        }
        if(!this.measure.equals(that.measure)){
            return false;
        }
        if(!this.quantity.equals(that.quantity)){
            return false;
        }
        if(!this.price.equals(that.price)){
            return false;
        }
        if(!this.manifestRemark.equals(that.manifestRemark)){
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        String hashStr = manifestId + manifestName + measure + quantity + price + manifestRemark;
        return Objects.hashCode(hashStr);
    }
}
